package com.sheng.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.sheng.mapper.OrderMapper;
import com.sheng.model.OrderModel;
import com.sheng.service.OrderService;


/**
 * 订单相关接口实现类
 * 
 * @Service 注解必填，标注这是一个接口实现！！
 */
@Service
public class OrderServiceImpl implements OrderService{
	
	@Autowired//spring 自动注入
    private OrderMapper orderMapper;
	
//	@Override //方法重写
//	public void createOrder(OrderModel order) {
//        String inserSql = "insert into biz_order "+
//        		"(order_no, total_amount, paid_amount, user_id, user_name,user_no, phone, merchant_id, merchant_name,merchant_tel,order_status,create_time) "+
//        		"values(?,?,?,?,?,?,?,?,?,?,?,?)";
//       
//
//        jdbcTemplate.update(inserSql, new Object[]{
//				order.getOrderNo(),
//				order.getTotalAmount(),
//				order.getPaidAmount(),
//				order.getUserId(),
//				order.getUserName(),
//				order.getUserNo(),
//				order.getPhone(),
//				order.getMerchantId(),
//				order.getMerchantName(),
//				order.getMerchantTel(),
//				order.getOrderStatus(),
//				new Date()
//		});
//	}
	
	@Override //方法重写
	public void createOrder() {
		this.orderMapper.createOrder("1","1","1",1,"1",1,1,1,"1",1,"1");

//		String deleteSql="delete from biz_order where order_id=?";
//		jdbcTemplate.update(deleteSql,orderId);
	}
	
	public void updateOrder(OrderModel order) {
		
	}

	@Override
	public void removeOrder(Integer orderId) {
		// TODO Auto-generated method stub
		
	}
}
